// 请求响应参数（不包含data）
export interface Result {
  code: string;
  msg: string;
}

// 请求响应参数（包含data）
export interface ResultData<T = any> extends Result {
  message: string;
  result: boolean;
  url?: string;
}

// 分页响应参数
export interface ResPage<T> {
  data: T[];
  page: number;
  size: number;
  total: number;
}

// 分页请求参数
export interface ReqPage {
  pageNum: number;
  pageSize: number;
}

// 文件上传模块
export namespace Upload {
  export interface ResFileUrl {
    fileUrl: string;
  }
}

// 登录模块
export namespace Login {
  export interface ReqLoginForm {
    username: string;
    password: string;
  }
  export interface ResLogin {
    access_token: string;
  }
  export interface ResAuthButtons {
    [key: string]: string[];
  }
}

// 用户管理模块
export namespace User {
  export interface ReqUserParams extends ReqPage {
    username: string;
    gender: number;
    idCard: string;
    email: string;
    address: string;
    createTime: string[];
    status: number;
  }
  export interface ResUserList {
    id: string;
    username: string;
    gender: number;
    user: { detail: { age: number } };
    idCard: string;
    email: string;
    address: string;
    createTime: string;
    status: number;
    avatar: string;
    photo: any[];
    children?: ResUserList[];
  }
  export interface ResStatus {
    userLabel: string;
    userValue: number;
  }
  export interface ResGender {
    genderLabel: string;
    genderValue: number;
  }
  export interface ResDepartment {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
  export interface ResRole {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
}

export interface AccountList {
  accountGroup: string;
  accountId: string;
  accountName: string;
  accountState: string;
  accountType: string;
  avatar: string;
  company: string;
  messageList: Record<string, any>[];
  mmId: string;
  phoneGroup: string;
  phoneIp: string;
  phoneName: string;
}

export interface DetailList {
  state: string;
  message: string;
  accountName: string;
  accountId: string;
}

export interface ResDetail {
  result: boolean;
  detailList: DetailList[];
}

export interface ResData {
  result: boolean;
  data: Record<string, any>;
}

export interface ResPass {
  sender: string;
  message: string;
  messageType: string;
  sendTime: string;
  messageId: string;
}

export interface ResPassResult {
  result: boolean;
  message: string;
  dataList: ResPass[];
  total: number;
}

export interface ResUser {
  result: boolean;
  userList: string[];
}

export interface ResDict {
  result: boolean;
  sortList: string[];
  groupList: string[];
  typeList: string[];
  stateList: string[];
}

export interface ResultTaskData {
  messageList: string[][];
  result: boolean;
  url?: string;
}

export interface VersionData {
  versionList: string[];
  result: boolean;
}
